home *** CD-ROM | disk | FTP | other *** search
/ Chip 2002 September / Chip_2002-09_cd1.bin / sharewar / slunec / app / httrack.exe / {app} / src_win / WinHTTrack / FirstInfo.cpp < prev    next >
C/C++ Source or Header  |  2002-06-24  |  4KB  |  167 lines

  1. // FirstInfo.cpp : implementation file
  2. //
  3.  
  4. #include "stdafx.h"
  5. #include "winhttrack.h"
  6. #include "FirstInfo.h"
  7.  
  8. #ifdef _DEBUG
  9. #define new DEBUG_NEW
  10. #undef THIS_FILE
  11. static char THIS_FILE[] = __FILE__;
  12. #endif
  13.  
  14. /* Main WizTab frame */
  15. #include "WizTab.h"
  16. extern CWizTab* this_CWizTab;
  17.  
  18. /* Main splitter frame */
  19. #include "DialogContainer.h"
  20. #include "splitter.h"
  21. extern CSplitterFrame* this_CSplitterFrame;
  22.  
  23. /* DirTreeView */
  24. #include "DirTreeView.h"
  25. extern CDirTreeView* this_DirTreeView;
  26.  
  27.  
  28. /////////////////////////////////////////////////////////////////////////////
  29. // CFirstInfo property page
  30.  
  31. IMPLEMENT_DYNCREATE(CFirstInfo, CPropertyPage)
  32.  
  33. CFirstInfo::CFirstInfo() : CPropertyPage(CFirstInfo::IDD)
  34. {
  35.     //{{AFX_DATA_INIT(CFirstInfo)
  36.         // NOTE: the ClassWizard will add member initialization here
  37.     //}}AFX_DATA_INIT
  38. }
  39.  
  40. CFirstInfo::~CFirstInfo()
  41. {
  42. }
  43.  
  44. void CFirstInfo::DoDataExchange(CDataExchange* pDX)
  45. {
  46.     CPropertyPage::DoDataExchange(pDX);
  47.     //{{AFX_DATA_MAP(CFirstInfo)
  48.     DDX_Control(pDX, IDC_SPLASH, m_splash);
  49.     //}}AFX_DATA_MAP
  50. }
  51.  
  52.  
  53. BEGIN_MESSAGE_MAP(CFirstInfo, CPropertyPage)
  54.     //{{AFX_MSG_MAP(CFirstInfo)
  55.     ON_WM_MOUSEMOVE()
  56.     ON_WM_LBUTTONDOWN()
  57.     //}}AFX_MSG_MAP
  58. END_MESSAGE_MAP()
  59.  
  60. /////////////////////////////////////////////////////////////////////////////
  61. // CFirstInfo message handlers
  62.  
  63. BOOL CFirstInfo::OnSetActive( ) {
  64.   WHTT_LOCATION("FirstInfo");
  65.   this_CWizTab->SetWizardButtons(PSWIZB_NEXT);
  66.   this_CWizTab->SetDlgItemText(IDCANCEL,LANG_QUIT);
  67.   this_DirTreeView->ResetTree();
  68.   this_CSplitterFrame->EnableSaveEntries(TRUE);
  69.   //GetParent()->GetDlgItem(IDCANCEL)->ModifyStyle(0,WS_DISABLED);
  70.   return 1;
  71. }
  72.  
  73. BOOL CFirstInfo::OnQueryCancel( ) {
  74.   //  if (AfxMessageBox(LANG(LANG_J1),MB_OKCANCEL)==IDOK) {
  75.   /* Envoyer un WM_CLOSE α notre fenΩtre principale */
  76.   AfxGetMainWnd()->SendMessage(WM_CLOSE,0,0);
  77.   //  }
  78.   return FALSE;
  79. }
  80.  
  81. BOOL CFirstInfo::OnInitDialog() 
  82. {
  83.     CPropertyPage::OnInitDialog();
  84.     EnableToolTips(true);     // TOOL TIPS
  85.  
  86.   WINDOWPLACEMENT wp;
  87.   m_splash.GetWindowPlacement(&wp);
  88.   wp.rcNormalPosition.right=wp.rcNormalPosition.left+300+1;
  89.   wp.rcNormalPosition.bottom=wp.rcNormalPosition.top+69+1; 
  90.   m_splash.SetWindowPlacement(&wp);
  91.  
  92.   // Patcher l'interface pour les Franτais ;-)
  93.   if (LANG_T(-1)) {    // Patcher en franτais
  94.     //SetDlgItemText(,"");
  95.     SetDlgItemText(IDC_STATIC_welcome,LANG_Y1);
  96.   }
  97.  
  98.     return TRUE;  // return TRUE unless you set the focus to a control
  99.                   // EXCEPTION: OCX Property Pages should return FALSE
  100. }
  101.  
  102.  
  103. // !! COPIE DE ABOUT.CPP !!
  104. void CFirstInfo::OnMouseMove(UINT nFlags, CPoint point) 
  105. {
  106.   int id=0;
  107.   CWnd* w=ChildWindowFromPoint(point);
  108.   if (w)
  109.     id=w->GetDlgCtrlID();
  110.  
  111.   // Select
  112.   switch(id) {
  113.   case 0: break;
  114.   case IDC_SPLASH:
  115.     this->ClientToScreen(&point);
  116.     w->ScreenToClient(&point);
  117.     HCURSOR curs=NULL;
  118.     if (
  119.          (point.y>=120) && (point.y<=140)
  120.       || (point.y<=80)
  121.       || (point.y>=100) && (point.y<=110)
  122.       ) {
  123.       curs=AfxGetApp()->LoadCursor(IDC_CURSWWW);
  124.     } else {
  125.       curs=AfxGetApp()->LoadStandardCursor(IDC_ARROW);
  126.     }
  127.     if (curs) {
  128.       //if (curs != currentCurs) {
  129.         SetCursor(curs);
  130.         // currentCurs=curs;
  131.       //}
  132.     }
  133.   }  
  134.  
  135.     CDialog::OnMouseMove(nFlags, point);
  136. }
  137.  
  138. void CFirstInfo::OnLButtonDown(UINT nFlags, CPoint point) 
  139. {
  140.   int id=0;
  141.   CWnd* w=ChildWindowFromPoint(point);
  142.   if (w)
  143.     id=w->GetDlgCtrlID();
  144.  
  145.   // Select
  146.   switch(id) {
  147.     case 0: break;
  148.     case IDC_SPLASH:
  149.       this->ClientToScreen(&point);
  150.       w->ScreenToClient(&point);
  151.     if ((point.y>=100) && (point.y<=110) || (point.y<=80)) {
  152.       if (!ShellExecute(NULL,"open","http://www.httrack.com","","",SW_RESTORE)) {
  153.       }
  154.     }
  155.     /*else if ((point.y>=120) && (point.y<=140)) {
  156.       if (!ShellExecute(NULL,"open","http://www.serianet.com","","",SW_RESTORE)) {
  157.       }
  158.     }
  159.     */
  160.     break;
  161.   }
  162.  
  163.   CDialog::OnLButtonDown(nFlags, point);
  164. }
  165. // !! FIN COPIE DE ABOUT.CPP !!
  166.  
  167.